﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    public enum npcType
    {
        WorkNpc,
        ShopNpc,
        IronNpc,
    }
    abstract class NPC
    {
        private string name;
        private npcType type;
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        public  npcType Type
        {
            get { return type; }
            set { type = value; }
        }
        public NPC(string name, npcType type)
        {
            this.Name = name;
            this.Type = type;
        }
        public NPC()
        {

        }
        public abstract void Hello();


    }
    class WorkNpc : NPC
    {
        private string workinfo;
        public string Workinfo
        {
            get { return workinfo; }
            set { workinfo = value; }
        }
        public WorkNpc(string name, npcType type, string workinfo) : base(name,type) {
            this.Workinfo = workinfo;
        }
        public override void Hello()
        {
            Console.WriteLine("你能帮帮我吗？，我是{0}，{1},任务:{2}", this.Name,this.Type, this.Workinfo);
        }
    }
    class ShopNpc:NPC {
        private string shopinfo;
        public string Shopinfo
        {
            get { return shopinfo; }
            set { shopinfo = value;}
        }

        public ShopNpc(string name, npcType type, string shopinfo):base(name, type)
        {
            this.Shopinfo = shopinfo;
        }

        public override void Hello()
        {
            Console.WriteLine("我是{0}，{1}:{2}",this.Name,this.Type, this.shopinfo);
        }
    }
    class IronNpc:NPC
    {
        private string ironinfo;
        public string Ironinfo
        {
            get { return ironinfo; }
            set { ironinfo = value; }
        }
        public IronNpc(string name, npcType type,string ironinfo):base(name,type)
        {
            this.Ironinfo = ironinfo;
        }

        public override void Hello()
        {
            Console.WriteLine("我是{0}，{1}:{2}",this.Name,this.Type,this.ironinfo);
        }
    }
}

